import axiosApi from "./AxiosApi.js";
// 布板
const swatchSchemeManage = {
  // 分页列表查询
  page: {
    url: `/xssc/controlSwatch/page`,
    method: "POST"
  },
  // 新增
  add: {
    url: `/xssc/controlSwatch`,
    method: "POST"
  },
  // 修改
  edit: {
    url: `/xssc/controlSwatch`,
    method: "PUT"
  },
  // 修改
  delete: {
    url: `/xssc/controlSwatch`,
    method: "DELETE"
  }
};

// 串联指标
const targetManage = {
  // 分页列表查询
  page: {
    url: `/xssc/indicator/page`,
    method: "POST"
  },
  // 新增
  add: {
    url: `/xssc/indicator`,
    method: "POST"
  },
  // 修改
  edit: {
    url: `/xssc/indicator`,
    method: "PUT"
  },
  // 修改
  delete: {
    url: `/xssc/indicator`,
    method: "DELETE"
  }
};

// 方案管理
const schemeManage = {
  // 分页列表查询
  page: {
    url: `/xssc/indicatorScheme/page`,
    method: "POST"
  },
  // 新增
  add: {
    url: `/xssc/indicatorScheme`,
    method: "POST"
  },
  // 修改
  edit: {
    url: `/xssc/indicatorScheme`,
    method: "PUT"
  },
  // 修改
  delete: {
    url: `/xssc/indicatorScheme`,
    method: "DELETE"
  }
};

// 指标切值
const indicatorReference = {
  // 分页列表查询
  page: {
    url: `/xssc/indicatorReference/page`,
    method: "POST"
  },
  // 新增
  add: {
    url: `/xssc/indicatorReference`,
    method: "POST"
  },
  // 修改
  edit: {
    url: `/xssc/indicatorReference`,
    method: "PUT"
  },
  // 删除
  delete: {
    url: `/xssc/indicatorReference`,
    method: "DELETE"
  },
};

// 质控
const traditionQualityControl = {
  // 分页列表查询
  page: {
    url: `/xssc/qualityControl/query`,
    method: "POST"
  },
  // 获取图表
  getPicture: {
    url: `/xssc/qualityControl/getPicture`,
    method: "POST"
  },
};

export default {
  swatchSchemeManage: {
    page(data) {
      return axiosApi({
        ...swatchSchemeManage.page,
        // formData: true,
        data
      });
    },
    add(data) {
      return axiosApi({
        ...swatchSchemeManage.add,
        // formData: true,
        data
      });
    },
    edit(data) {
      return axiosApi({
        ...swatchSchemeManage.edit,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...swatchSchemeManage.delete,
        // formData: true,
        data
      });
    },
    getById(data) {
      return axiosApi({
        url: `/xssc/controlSwatch/${data}`,
        method: 'GET'
      })
    }

  },
  targetManage: {
    page(data) {
      return axiosApi({
        ...targetManage.page,
        // formData: true,
        data
      });
    },
    add(data) {
      return axiosApi({
        ...targetManage.add,
        // formData: true,
        data
      });
    },
    edit(data) {
      return axiosApi({
        ...targetManage.edit,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...targetManage.delete,
        // formData: true,
        data
      });
    }
  },
  schemeManage: {
    page(data) {
      return axiosApi({
        ...schemeManage.page,
        // formData: true,
        data
      });
    },
    add(data) {
      return axiosApi({
        ...schemeManage.add,
        // formData: true,
        data
      });
    },
    edit(data) {
      return axiosApi({
        ...schemeManage.edit,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...schemeManage.delete,
        // formData: true,
        data
      });
    }
  },
  indicatorReference: {
    page(data) {
      return axiosApi({
        ...indicatorReference.page,
        // formData: true,
        data
      });
    },
    add(data) {
      return axiosApi({
        ...indicatorReference.add,
        // formData: true,
        data
      });
    },
    edit(data) {
      return axiosApi({
        ...indicatorReference.edit,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...indicatorReference.delete,
        // formData: true,
        data
      });
    }
  },
  traditionQualityControl: {
    page(data) {
      return axiosApi({
        ...traditionQualityControl.page,
        // formData: true,
        data
      });
    },
    getPicture(data) {
      return axiosApi({
        ...traditionQualityControl.getPicture,
        // formData: true,
        data
      });
    },
  }
};
